import React from 'react'
import ReactDOM from 'react-dom/client'
import { BrowserRouter } from 'react-router-dom'

// 导入redux-persist提供PersistGate组件
import { PersistGate } from 'redux-persist/integration/react'

// 导入React Redux 提供的Provider 组件
import { Provider } from 'react-redux'

import { store, persistor } from './store/index.js'

import App from './App'
// 引入全局样式文件
import './index.scss'
import 'normalize.css/normalize.css'

const root = ReactDOM.createRoot(document.getElementById('root'))
root.render(
  <Provider store={store}>
    <PersistGate loading={null} persistor={persistor}>
      <BrowserRouter>
        <App />
      </BrowserRouter>
    </PersistGate>
  </Provider>
)
